package boerse.main;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Locale;
import java.util.ResourceBundle;

/**
 * Make the ResourcheBundle for different languages
 * @author Domi
 *
 */
public class Language {

	private ResourceBundle fileConventions;
	private Locale locale;
	
	public Language() {
		try {
		FileReader fr = new FileReader("GameCfg.txt");
        BufferedReader br = new BufferedReader(fr);

        String language = br.readLine();
        String country = br.readLine();       
            
        locale = new Locale(language, country);
        
        fileConventions =  ResourceBundle.getBundle("language", locale);
        
        br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public ResourceBundle getResourceBundle() {
		return fileConventions;
	}
	
	public Locale getLocale() {
		return locale;
	}
}
